import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter);
const routes = [
    {
        path: '/index',
        name: 'index',
        component: ()=> import("../views/index.vue"),
        meta: {
            title: '可视化选股'
        }
    }, 
];
const router = new VueRouter({
    linkActiveClass: 'active',
    base: process.env.BASE_URL,
    routes
});
//路由后置钩子
router.afterEach((to, from) => {
    //设置头部标题
    if (to.meta.title) document.title = to.meta.title;
});
export default router;